feat(version): print RootlessKit version in nerdctl version#4966
Closed
jfjrh2014 wants to merge 1 commit into
Closed
feat(version): print RootlessKit version in nerdctl version#4966jfjrh2014 wants to merge 1 commit into
nerdctl version#4966jfjrh2014 wants to merge 1 commit into
Conversation
Add rootlesskitVersion() to ClientVersion components, shelling out to `rootlesskit --version` the same way runcVersion() and buildctlVersion() already do. When rootlesskit is not installed the output gracefully degrades to a bare "rootlesskit" entry with no version, matching the behavior of the other optional components. Closes containerd#4936
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
nerdctl versionnow prints the RootlessKit version in the same format thatdocker versionuses for its auxiliary components (buildctl, runc).Why
Closes #4936.
Users running rootless containers have no quick way to see which RootlessKit version they're on from nerdctl itself. They currently have to shell out to `rootlesskit --version` separately. Docker shows runtime tooling versions in its version output; nerdctl already follows this pattern for `buildctl` and `runc` but was missing RootlessKit.
How
Adds `rootlesskitVersion()` alongside the existing `buildctlVersion()` and `runcVersion()` in `pkg/infoutil`. It shells out to `rootlesskit --version`, parses the output with `parseRootlesskitVersion()`, and returns a `dockercompat.ComponentVersion`.
When RootlessKit is not installed, the output gracefully degrades to a bare `rootlesskit` entry with no version — identical to how `buildctlVersion()` behaves when buildctl is missing.
Sample output:
```
Client:
Version: 1.0.0
OS/Arch: linux/amd64
Git commit: ...
buildctl:
Version: v0.20.2
GitCommit: ...
rootlesskit:
Version: 2.0.2
GitCommit: ...
```